// Agent contractor in project COMP667-Proj


/* Plans */

// send a message to the initiator introducing myself as a participant for a particular role
+role_introduction(Role,Initiator)
   :  .my_name(Me)
   <- .send(Initiator,tell,introduction(Role,Me)).

// answer to Call For Proposal   
//@c1 +cfp(CNPId,Task)[source(A)]
//   :  plays(initiator,A) & price(Task,Offer)
//   <- +proposal(CNPId,Task,Offer); // remember my proposal
//      .send(A,tell,propose(CNPId,Offer)).
	  
//@c2 +cfp(CNPId,Task)[source(A)]//if the cfp didn't come from the initiator then
//refuse the cfp.
//	: ~plays(initiator,A)
//	 <- .send(A,tell,refuse(CNPId)).
	 
//@r1 +accept_proposal(CNPId)
//   :  proposal(CNPId,Task,Offer)
//   <- .print("My proposal '",Offer,"' won CNP ",CNPId,
//             " for ",Task,"!");
//			 !Task;
 //       	  ?plays(initiator,A);
//			 .send(A,tell,completed_contract(CNPId)).
      // do the task and report to initiator
      
//@r2 +reject_proposal(CNPId)
//   <- .print("I lost CNP ",CNPId, ".");
//      -proposal(CNPId,_,_,_). // clear memory

